
farmerId = 42

function masterServer()
	while true do
		event, param1, param2, param3 = os.pullEvent()
		
		if event == 'key' then
			if param1 == 28 then
				-- Enter key
				return
			end
		elseif event == 'rednet_message' then
			if param1 == farmerId then
				print("farmer: "..param2)
			end
		end
	end
end

rednet.open("left")
rednet.send(farmerId, "start")
masterServer()